#coding=utf-8

#报表
#time:20170914

import wx
#报表面板
class StatementPanel(wx.Panel):
	def __init__(self, parent,id=-1,pos=wx.DefaultPosition, size=(-1, -1)):
		wx.Panel.__init__(self, parent,id, pos, size)
		self.SetBackgroundColour("#e7eced")
		self.parent = parent

		self.p1 = wx.Panel(self,-1,size=(480,245),pos=(10,10))
		self.p1.SetBackgroundColour('#ffffff')
		
		self.p2 = wx.Panel(self,-1,size=(480,245),pos=(490,10))
		self.p2.SetBackgroundColour('#ffffff')

		self.p3 = wx.Panel(self,-1,size=(480,245),pos=(10,270))
		self.p3.SetBackgroundColour('#ffffff')

		self.p4 = wx.Panel(self,-1,size=(480,245),pos=(490,270))
		self.p4.SetBackgroundColour('#ffffff')

		self.OnP1ShowView()
		self.OnP2ShowView()
		self.OnP3ShowView()
		self.OnP4ShowView()

		self.Bind(wx.EVT_SIZE,self.OnSetSize)


	#当大小变化时触发
	def OnSetSize(self,evt):
		if self.parent.IsIconized():
			return

		self.parentSize = self.parent.GetSize()
		self.width = self.parentSize[0]-160 
		self.height = self.parentSize[1]-120

		self.p1.SetSize(wx.Size(self.width/2,self.height/2))
		self.p2.SetSize(wx.Size(self.width/2,self.height/2))
		self.p3.SetSize(wx.Size(self.width/2,self.height/2))
		self.p4.SetSize(wx.Size(self.width/2,self.height/2))
		self.p1titleP.SetSize(wx.Size(self.width/2-4,30))
		self.p2titleP.SetSize(wx.Size(self.width/2-4,30))
		self.p3titleP.SetSize(wx.Size(self.width/2-4,30))
		self.p4titleP.SetSize(wx.Size(self.width/2-4,30))


		self.p1.SetPosition((10,10))
		self.p2.SetPosition((self.width/2+20,10))
		self.p3.SetPosition((10,self.height/2+20))
		self.p4.SetPosition((self.width/2+20,self.height/2+20))

		self.Refresh()


	def OnP1ShowView(self):
		self.parentSize = self.parent.GetSize()
		self.width = self.parentSize[0]-160 
		self.height = self.parentSize[1]-120
		self.p1titleP = wx.Panel(self.p1,-1,size=(self.width/2-4,30),pos=(2,2))
		self.p1titleP.SetBackgroundColour('#f5f6f8')
		titleText = wx.StaticText(self.p1titleP,-1,u'采购报表',pos=(40,5))
		#Titlepng图标
		b = wx.Image('images/main/ooopic_1504429503.png',wx.BITMAP_TYPE_PNG).Scale(32,32)
		wx.StaticBitmap(self.p1titleP,-1,wx.Bitmap(b),pos=(5,0))

		self.crpriceP = wx.Panel(self.p1,-1,pos=(15,50),size=(400,50))
		self.crpriceP.SetBackgroundColour('#f5f6f8')
		self.crpricePL = wx.Panel(self.crpriceP,-1,pos=(0,0),size=(5,50))
		self.crpricePL.SetBackgroundColour('#76c2af')
		self.caigoumingxi = wx.StaticText(self.crpriceP,-1,u'采购明细表',pos=(10,7))
		self.caigoumingxi.SetFont(wx.Font(24,wx.DEFAULT, wx.NORMAL, wx.BOLD))
		self.caigoumingxi.SetForegroundColour('#67737c')

		self.crpriceP = wx.Panel(self.p1,-1,pos=(15,110),size=(400,50))
		self.crpriceP.SetBackgroundColour('#f5f6f8')
		self.crpricePL = wx.Panel(self.crpriceP,-1,pos=(0,0),size=(5,50))
		self.crpricePL.SetBackgroundColour('#76c2af')
		self.caigoumingxi = wx.StaticText(self.crpriceP,-1,u'采购明细表(按商品)',pos=(10,7))
		self.caigoumingxi.SetFont(wx.Font(24,wx.DEFAULT, wx.NORMAL, wx.BOLD))
		self.caigoumingxi.SetForegroundColour('#67737c')

		self.crpriceP = wx.Panel(self.p1,-1,pos=(15,170),size=(400,50))
		self.crpriceP.SetBackgroundColour('#f5f6f8')
		self.crpricePL = wx.Panel(self.crpriceP,-1,pos=(0,0),size=(5,50))
		self.crpricePL.SetBackgroundColour('#76c2af')
		self.caigoumingxi = wx.StaticText(self.crpriceP,-1,u'采购明细表(按供应商)',pos=(10,7))
		self.caigoumingxi.SetFont(wx.Font(24,wx.DEFAULT, wx.NORMAL, wx.BOLD))
		self.caigoumingxi.SetForegroundColour('#67737c')

		



	def OnP2ShowView(self):
		self.parentSize = self.parent.GetSize()
		self.width = self.parentSize[0]-160 
		self.height = self.parentSize[1]-120
		self.p2titleP = wx.Panel(self.p2,-1,size=(self.width/2-4,30),pos=(2,2))
		self.p2titleP.SetBackgroundColour('#f5f6f8')
		titleText = wx.StaticText(self.p2titleP,-1,u'销售报表',pos=(40,5))
		#Titlepng图标
		b = wx.Image('images/main/ooopic_1504429503.png',wx.BITMAP_TYPE_PNG).Scale(32,32)
		wx.StaticBitmap(self.p2titleP,-1,wx.Bitmap(b),pos=(5,0))

		self.crpriceP = wx.Panel(self.p2,-1,pos=(15,50),size=(400,50))
		self.crpriceP.SetBackgroundColour('#f5f6f8')
		self.crpricePL = wx.Panel(self.crpriceP,-1,pos=(0,0),size=(5,50))
		self.crpricePL.SetBackgroundColour('#e0995e')
		self.caigoumingxi = wx.StaticText(self.crpriceP,-1,u'销售明细表',pos=(10,7))
		self.caigoumingxi.SetFont(wx.Font(24,wx.DEFAULT, wx.NORMAL, wx.BOLD))
		self.caigoumingxi.SetForegroundColour('#67737c')

		self.crpriceP = wx.Panel(self.p2,-1,pos=(15,110),size=(400,50))
		self.crpriceP.SetBackgroundColour('#f5f6f8')
		self.crpricePL = wx.Panel(self.crpriceP,-1,pos=(0,0),size=(5,50))
		self.crpricePL.SetBackgroundColour('#e0995e')
		self.caigoumingxi = wx.StaticText(self.crpriceP,-1,u'销售明细表(按商品)',pos=(10,7))
		self.caigoumingxi.SetFont(wx.Font(24,wx.DEFAULT, wx.NORMAL, wx.BOLD))
		self.caigoumingxi.SetForegroundColour('#67737c')

		self.crpriceP = wx.Panel(self.p2,-1,pos=(15,170),size=(400,50))
		self.crpriceP.SetBackgroundColour('#f5f6f8')
		self.crpricePL = wx.Panel(self.crpriceP,-1,pos=(0,0),size=(5,50))
		self.crpricePL.SetBackgroundColour('#e0995e')
		self.caigoumingxi = wx.StaticText(self.crpriceP,-1,u'销售明细表(按客户)',pos=(10,7))
		self.caigoumingxi.SetFont(wx.Font(24,wx.DEFAULT, wx.NORMAL, wx.BOLD))
		self.caigoumingxi.SetForegroundColour('#67737c')


	def OnP3ShowView(self):
		self.parentSize = self.parent.GetSize()
		self.width = self.parentSize[0]-160 
		self.height = self.parentSize[1]-120
		self.p3titleP = wx.Panel(self.p3,-1,size=(self.width/2-4,30),pos=(2,2))
		self.p3titleP.SetBackgroundColour('#f5f6f8')
		titleText = wx.StaticText(self.p3titleP,-1,u'仓库报表',pos=(40,5))
		#Titlepng图标
		b = wx.Image('images/main/ooopic_1504429503.png',wx.BITMAP_TYPE_PNG).Scale(32,32)
		wx.StaticBitmap(self.p3titleP,-1,wx.Bitmap(b),pos=(5,0))

		self.crpriceP = wx.Panel(self.p3,-1,pos=(15,50),size=(400,50))
		self.crpriceP.SetBackgroundColour('#f5f6f8')
		self.crpricePL = wx.Panel(self.crpriceP,-1,pos=(0,0),size=(5,50))
		self.crpricePL.SetBackgroundColour('#029be2')
		self.caigoumingxi = wx.StaticText(self.crpriceP,-1,u'库存余额表',pos=(10,7))
		self.caigoumingxi.SetFont(wx.Font(24,wx.DEFAULT, wx.NORMAL, wx.BOLD))
		self.caigoumingxi.SetForegroundColour('#67737c')

		self.crpriceP = wx.Panel(self.p3,-1,pos=(15,110),size=(400,50))
		self.crpriceP.SetBackgroundColour('#f5f6f8')
		self.crpricePL = wx.Panel(self.crpriceP,-1,pos=(0,0),size=(5,50))
		self.crpricePL.SetBackgroundColour('#029be2')
		self.caigoumingxi = wx.StaticText(self.crpriceP,-1,u'商品收发明细表',pos=(10,7))
		self.caigoumingxi.SetFont(wx.Font(24,wx.DEFAULT, wx.NORMAL, wx.BOLD))
		self.caigoumingxi.SetForegroundColour('#67737c')

		self.crpriceP = wx.Panel(self.p3,-1,pos=(15,170),size=(400,50))
		self.crpriceP.SetBackgroundColour('#f5f6f8')
		self.crpricePL = wx.Panel(self.crpriceP,-1,pos=(0,0),size=(5,50))
		self.crpricePL.SetBackgroundColour('#029be2')
		self.caigoumingxi = wx.StaticText(self.crpriceP,-1,u'商品收发汇总表',pos=(10,7))
		self.caigoumingxi.SetFont(wx.Font(24,wx.DEFAULT, wx.NORMAL, wx.BOLD))
		self.caigoumingxi.SetForegroundColour('#67737c')



	def OnP4ShowView(self):
		self.parentSize = self.parent.GetSize()
		self.width = self.parentSize[0]-160 
		self.height = self.parentSize[1]-120
		self.p4titleP = wx.Panel(self.p4,-1,size=(self.width/2-4,30),pos=(2,2))
		self.p4titleP.SetBackgroundColour('#f5f6f8')
		titleText = wx.StaticText(self.p4titleP,-1,u'资金报表',pos=(40,5))
		#Titlepng图标
		b = wx.Image('images/main/ooopic_1504429503.png',wx.BITMAP_TYPE_PNG).Scale(32,32)
		wx.StaticBitmap(self.p4titleP,-1,wx.Bitmap(b),pos=(5,0))

		self.crpriceP = wx.Panel(self.p4,-1,pos=(15,50),size=(400,50))
		self.crpriceP.SetBackgroundColour('#f5f6f8')
		self.crpricePL = wx.Panel(self.crpriceP,-1,pos=(0,0),size=(5,50))
		self.crpricePL.SetBackgroundColour('#ffce44')
		self.caigoumingxi = wx.StaticText(self.crpriceP,-1,u'付款明细表',pos=(10,7))
		self.caigoumingxi.SetFont(wx.Font(24,wx.DEFAULT, wx.NORMAL, wx.BOLD))
		self.caigoumingxi.SetForegroundColour('#67737c')

		self.crpriceP = wx.Panel(self.p4,-1,pos=(15,110),size=(400,50))
		self.crpriceP.SetBackgroundColour('#f5f6f8')
		self.crpricePL = wx.Panel(self.crpriceP,-1,pos=(0,0),size=(5,50))
		self.crpricePL.SetBackgroundColour('#ffce44')
		self.caigoumingxi = wx.StaticText(self.crpriceP,-1,u'收款明细表',pos=(10,7))
		self.caigoumingxi.SetFont(wx.Font(24,wx.DEFAULT, wx.NORMAL, wx.BOLD))
		self.caigoumingxi.SetForegroundColour('#67737c')

		self.crpriceP = wx.Panel(self.p4,-1,pos=(15,170),size=(400,50))
		self.crpriceP.SetBackgroundColour('#f5f6f8')
		self.crpricePL = wx.Panel(self.crpriceP,-1,pos=(0,0),size=(5,50))
		self.crpricePL.SetBackgroundColour('#ffce44')
		self.caigoumingxi = wx.StaticText(self.crpriceP,-1,u'对账单',pos=(10,7))
		self.caigoumingxi.SetFont(wx.Font(24,wx.DEFAULT, wx.NORMAL, wx.BOLD))
		self.caigoumingxi.SetForegroundColour('#67737c')
